home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / C++ / Frameworks / TransSkel++ 305 / Documents / Project Models next >
Text File  |  1996-06-28  |  7KB  |  155 lines

  1.  
  2.  
  3.  
  4. The TransSkel++ Project Models
  5. ==============================
  6.  
  7.    The TransSkel++ package includes a project models for use with 
  8.    Symantec C++ and MetroWerks C/C++ for 68K and PPC.  With these 
  9.    project models, you can swiftly create TransSkel++ projects 
  10.    with an Apple, File, and Edit menu, an About non-modal dialog 
  11.    box, and an unlimited number of windows.  You can use these 
  12.    project models to learn about TransSkel++ or to serve as a 
  13.    base for future TransSkel++ projects.
  14.  
  15. Installation
  16. ------------
  17.  
  18.    You must first install TransSkel++ as per the installation 
  19.    instructions in order to use the project models.
  20.  
  21.    Beginning with release 3.05, the Project Models folder is organized
  22.    more efficiently.  The downside is that you must do some assembly
  23.    in order to create project models for the desired compiler and
  24.    platform.  Beginning with release 3.05, the Project Models folder
  25.    contains stationary for MetroWerks CW9 projects for both 68K and
  26.    PowerPC targets, as well as a "stationary" project (@1.π) for
  27.    Symantec C/C++.  All the source files for the project are in the
  28.    "source" directory, and all the resource files are in the "resource"
  29.    directory.  
  30.  
  31.    Neither organization is acceptable for MetroWerks or Symantec stationary
  32.    or project models, so you must construct a project model or stationary folder
  33.    appropriate for the compiler and target machine.
  34.  
  35.    Symantec C/C++
  36.  
  37.    Create a folder in the Project Model folder in the (Project Models) folder 
  38.    in the Symantec C/C++ folder.  Call it something appropriate (e.g., "TransSkel++/SY-68K").  
  39.    The name you choose will be the name that appears in the Project Modle popup 
  40.    in the New Project dialog box.  Place the Symantec project "@1.π" in this 
  41.    folder, together with the source files in the "source" directory and the 
  42.    resource file "@1.π.rsrc" in the "resource" directory.  Do not copy the
  43.    folders; Symantec reads only files in a project model folder, not directories.
  44.  
  45.    MetroWerks C/C++
  46.  
  47.    MetroWerks project model support is a bit clumsy, so I don't 
  48.    wholeheartedly recommend using it for this project.  Instead, 
  49.    I recommend keeping the Project Stationary folder in a safe place 
  50.    and copying it when you want to create  a new MetroWerks TransSkel++ 
  51.    project.  The problem with MetroWerks stationary is that the files 
  52.    which make up the stationary pad are not automatically copied like they 
  53.    are in the Symantec IDE; this project model, however, requires copies 
  54.    of the source code which may eventually be edited.
  55.  
  56.  
  57. Creating a TransSkel++ Project
  58. ------------------------------
  59.  
  60. Symantec C/C++
  61.  
  62.    After you have installed the TransSkel++ Project Model, you 
  63.    may select the TransSkel++ Project in the New Project dialog 
  64.    box.  Symantec C++ will prompt you for a project name, 
  65.    whereupon copies of the files that make up the TransSkel++ 
  66.    Project Model will be automatically copied to the desired 
  67.    directory.  The project name is adjusted accordingly.
  68.  
  69. MetroWerks C/C++
  70.  
  71.    Copy the Project Stationary folder to a desired 
  72.    location.  Open the TransSkel++/MW-XXX.µ.stat stationary pad 
  73.    and provide a name for your project.  The application file 
  74.    name will be automatically changed for you.
  75.    
  76.  
  77. General Description
  78. -------------------
  79.  
  80.    The TransSkel++ Project Model defines subclasses of the 
  81.    TransSkel++ base classes corresponding to the typical objects 
  82.    in an application: An Apple menu with one About… item, a File 
  83.    menu with a New, Open…, Close, Save, Save As…, Page Setup…, 
  84.    Print, and Quit item, an Edit menu with the standard Undo, 
  85.    Cut, Copy, Paste, and Clear items, an About dialog box with an 
  86.    OK button, and an unlimited number of resizeable windows.  
  87.    Finally, there is the application itself, which routes events 
  88.    to the various objects mentioned above.
  89.  
  90.    The classes defined for managing these Macintosh objects are 
  91.    described in detail below.
  92.  
  93.    • CApp                         Superclass: CApplication
  94.  
  95.       The CApp class is the only subclass of the CApplication 
  96.       class, and only one instance is created in main().  (See 
  97.       main.cp) One global pointer, gApp, is set to the address of 
  98.       the only instance of this class, and this pointer serves as 
  99.       a global means of accessing all major objects in the 
  100.       application.
  101.  
  102.       This class shadows the CApplication doMenuHook() virtual 
  103.       function, which adjusts the Close item in the File menu, 
  104.       depending on whether any windows are open.
  105.  
  106.    • C_AppleMenu                  Superclass: CAppleMenu
  107.    
  108.       A subclass of CAppleMenu is needed to shadow the CAppleMenu 
  109.       doSelect virtual function.  The C_AppleMenu's doSelect 
  110.       member function opens the application's About dialog box.
  111.  
  112.    • CFileMenu                    Superclass: CMenu
  113.    
  114.       The CFile menu's doSelect member function creates a new 
  115.       C_Window if the New item was selected, closes the frontmost 
  116.       window if one was open and the Close item was selected, and 
  117.       signals to exit the application if the Quit item was 
  118.       selected.
  119.    
  120.    • CEditMenu                    Superclass: CMenu
  121.    
  122.       The CEditMenu class doesn't do much of anything and is 
  123.       provided for compatability with the User Interface 
  124.       Guidelines and for future use in the project.
  125.    
  126.    • CAboutDialog                 Superclass: CDialog
  127.    
  128.       The CAboutDialog class includes a filter member function 
  129.       doFilter, which correctly draws the dialog button if the 
  130.       dialog is activated or deactivated and maps keystrokes to 
  131.       button actions.  The doSelect member function closes the 
  132.       dialog via the CDialog doClose memberfunction (which only 
  133.       calls HideWindow()).
  134.    
  135.    • C_Window                     Superclass: CWindow
  136.    
  137.       The C_Window class is a bit of a dummy class; it's 
  138.       primarily here as an example and a template for future use 
  139.       in a project.  The doClose member function deletes the 
  140.       instance of the owning class, which turns out to be safe 
  141.       because automatic invocation of doClose() makes no future 
  142.       references to the referent of 'this'.
  143.  
  144.  
  145.  
  146.  
  147.    You'll typically want to modify all of the above files in some 
  148.    way.  I generally place all the variables I would make global 
  149.    in the CApp class so as to minimize global storage.  If you 
  150.    add functionality to your menus, you'll want to edit the 
  151.    CFileMenu and CEditMenu classes, or add definitions for new 
  152.    ones.  Similarly, the C_Window class serves as a template for 
  153.    new window definitions.
  154.  
  155.